package training;

import java.util.Scanner;
// https://www.nowcoder.com/questionTerminal/5973a31d58234b068fa1fe34f7290855
public class Day34_01 {

    // 注意类名必须为 test.Main, 不要有任何 package xxx 信息
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) {
            int a = in.nextInt();
            String[] strings = new String[a + 1];
            for (int i = 0; i < strings.length; i++) {
                strings[i] = in.nextLine();
            }
            for (int i = 1; i < strings.length; i++) {
                if (strings[i].indexOf(' ') != -1 || strings[i].indexOf(',') != -1) {
                    strings[i] = "\"" + strings[i] + "\"";
                }
                if (i == strings.length - 1) {
                    System.out.print(strings[i]);
                } else {
                    System.out.print(strings[i] + ", ");
                }
            }
            System.out.println();
        }
    }
}

